package com.hackerrank.challenges.leibnizz;

import java.util.Scanner;public class Solution{public static void main(String[] args){Scanner in=new Scanner(System.in);int T=in.nextInt();for(int t=0;t<T;t++){int n=in.nextInt();double a=0;for(int i=0;i<n;i++)a+=Math.pow(-1,i)/(2*i+1);System.out.printf("%17.15f\n",a);}}}
